package com.woniuxy.controller;

import com.woniuxy.anno.PreAuthorize;
import com.woniuxy.entity.Menu;
import com.woniuxy.service.MenuService;
import com.woniuxy.until.ResponseData;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * FileName: MenuController
 * Author: wujiajun
 * Date:   2025/1/13 16:47
 * Description:DOTO
 */
@RestController
@RequestMapping("/menu")
public class MenuController {
    @Resource
    private MenuService menuService;
    @GetMapping("/queryMenu")
    public ResponseData<?> queryUserMenu(){
        List<Menu> menus = menuService.queryUserMenu(1);
        return new ResponseData<>().success(menus);
    }
    @GetMapping("/updateMenu")
    @PreAuthorize(value = {"updateMenu","update"})// 权限注解，标识该接口是受访问控制
    public ResponseData<?> updateMenu(){

        return new ResponseData<>().success();
    }
}
